package com.feeyin.radar.interceptor;

import com.feeyin.radar.filter.LoginFilter;
import java.io.PrintStream;
import java.lang.reflect.Method;
import org.springframework.aop.MethodBeforeAdvice;

public class TestBeforeAdvice
  implements MethodBeforeAdvice
{
  public void before(Method arg0, Object[] arg1, Object arg2)
    throws Throwable
  {
    System.out.println("---------------------------------------------------");

    if (LoginFilter.getThreadLocalUserId() != null) {
      System.out.println("userId = " + LoginFilter.getThreadLocalUserId());
    }
    System.out.println("arg0 = " + arg0.getName());
    System.out.println("arg1 = " + arg1.getClass());
    System.out.println("arg2 = " + arg2.getClass());

    if (arg0.getName().equals("insertContract"))
      System.out.println("insertContract================================");
  }
}